import cv2
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False


# 加入椒盐噪声
plt.subplot(221)
plt.title('orginal')
img = cv2.imread('road.png')

for i in range(150, 200, 20):
    for j in range(250, 300, 20):
        edged = cv2.Canny(img, i, j)
        plt.imshow(edged)
        plt.show()